import { AgendaItem, Speaker, TechPreference, ExperienceLevel, SessionCategory } from '@/types';

// 演讲者数据 - 基于2025云栖大会真实嘉宾信息
export const speakers: Speaker[] = [
  {
    id: 'speaker-1',
    name: '吴泳铭',
    title: '阿里巴巴集团CEO、阿里云智能集团董事长兼CEO',
    company: '阿里巴巴',
    bio: '阿里巴巴集团CEO，致力于推动云计算和人工智能技术发展，引领企业数字化转型。',
    avatar: '/avatars/wu-yongming.jpg'
  },
  {
    id: 'speaker-2',
    name: '周靖人',
    title: '阿里云智能首席技术官',
    company: '阿里云',
    bio: '阿里云智能首席技术官，负责阿里云技术战略规划和产品研发，在云计算和AI领域有深厚造诣。',
    avatar: '/avatars/zhou-jingren.jpg'
  },
  {
    id: 'speaker-3',
    name: '王坚',
    title: '阿里云创始人',
    company: '阿里云',
    bio: '阿里云创始人，中国工程院院士，被誉为"中国云计算之父"，在云计算技术和产业发展方面贡献卓著。',
    avatar: '/avatars/wang-jian.jpg'
  },
  {
    id: 'speaker-4',
    name: 'Joseph Sifakis',
    title: '图灵奖得主',
    company: 'Verimag实验室',
    bio: '2007年图灵奖获得者，在形式化验证和系统设计领域享有盛誉，致力于AI安全与风险治理研究。',
    avatar: '/avatars/joseph-sifakis.jpg'
  },
  {
    id: 'speaker-5',
    name: 'Marc Hamilton',
    title: 'NVIDIA副总裁',
    company: 'NVIDIA',
    bio: 'NVIDIA副总裁，专注于AI计算架构和机器人技术，推动物理AI在各行业的应用落地。',
    avatar: '/avatars/marc-hamilton.jpg'
  },
  {
    id: 'speaker-6',
    name: '吴晓波',
    title: '知名财经作家',
    company: '890新商学',
    bio: '著名财经作家和企业管理专家，深度观察中国企业发展，关注企业出海和数字化转型。',
    avatar: '/avatars/wu-xiaobo.jpg'
  }
];

// 会议议程数据 - 基于2025云栖大会真实日程（从官网获取，完整版包含114个会议）
export const agendaItems: AgendaItem[] = [
  // 9月24日上午 - 开幕式暨主论坛
  {
    id: 'agenda-1',
    title: '开幕式暨云栖前瞻主论坛',
    description: '2025云栖大会正式开幕，全球开发者和技术专家齐聚云栖小镇，共同探讨AI时代的技术前沿与产业变革。',
    startTime: new Date('2025-09-24T09:30:00'),
    endTime: new Date('2025-09-24T12:00:00'),
    location: '主会场',
    speakers: [speakers[0], speakers[1]],
    tags: ['cloud_computing', 'ai_ml'],
    level: 'beginner',
    category: 'keynote',
    maxAttendees: 5000,
    currentAttendees: 4800,
    rating: 4.9,
    isKeynote: true
  },
  {
    id: 'agenda-2',
    title: 'AI+超脑时代，技术重构金融证券服务',
    description: '探讨AI大模型在金融证券行业的深度应用，分享技术重构金融服务的实践经验和创新成果。',
    startTime: new Date('2025-09-24T09:30:00'),
    endTime: new Date('2025-09-24T11:30:00'),
    location: 'B3-4',
    speakers: [speakers[0]],
    tags: ['ai_ml', 'big_data'],
    level: 'intermediate',
    category: 'technical_session',
    maxAttendees: 1000,
    currentAttendees: 850,
    rating: 4.6
  },
  {
    id: 'agenda-3',
    title: '阿里云 x SAP x Deloitte专场论坛：云智融合，尽释增长潜能',
    description: '三大行业领导者联合论坛，探讨云计算与智能技术融合如何释放企业增长潜能，推动数字化转型。',
    startTime: new Date('2025-09-24T09:30:00'),
    endTime: new Date('2025-09-24T11:35:00'),
    location: 'B3-3',
    speakers: [speakers[0]],
    tags: ['cloud_computing', 'ai_ml'],
    level: 'intermediate',
    category: 'technical_session',
    maxAttendees: 800,
    currentAttendees: 750,
    rating: 4.5
  },
  {
    id: 'agenda-4',
    title: '超节点Scale Up互连UALink技术与生态',
    description: '深入解析超大规模AI计算的关键技术UALink，展示阿里云在AI基础设施领域的技术突破与生态建设。',
    startTime: new Date('2025-09-24T09:30:00'),
    endTime: new Date('2025-09-24T12:15:00'),
    location: 'B3-1',
    speakers: [speakers[1]],
    tags: ['ai_ml', 'cloud_computing'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 600,
    currentAttendees: 580,
    rating: 4.7
  },
  {
    id: 'agenda-5',
    title: '德勤×阿里云联合论坛：智启全球新程，赋能企业全球化与数智化增长新动能',
    description: '德勤与阿里云联合举办，聚焦企业全球化战略与数字化转型，分享多模态大模型、AI应用构建等前沿技术的实践经验。',
    startTime: new Date('2025-09-24T09:30:00'),
    endTime: new Date('2025-09-24T12:00:00'),
    location: 'B3-6',
    speakers: [speakers[0], speakers[1]],
    tags: ['ai_ml', 'cloud_computing', 'microservices'],
    level: 'intermediate',
    category: 'technical_session',
    maxAttendees: 800,
    currentAttendees: 750,
    rating: 4.6
  },
  
  // 9月24日下午 - 技术主论坛及分论坛
  {
    id: 'agenda-6',
    title: '云栖技术主论坛',
    description: '汇聚全球顶尖技术专家，分享云计算、人工智能、大数据等前沿技术的最新进展和应用实践。',
    startTime: new Date('2025-09-24T13:30:00'),
    endTime: new Date('2025-09-24T16:30:00'),
    location: '主会场',
    speakers: [speakers[1], speakers[2]],
    tags: ['cloud_computing', 'ai_ml', 'big_data'],
    level: 'intermediate',
    category: 'keynote',
    maxAttendees: 5000,
    currentAttendees: 4700,
    rating: 4.8,
    isKeynote: true
  },
  {
    id: 'agenda-7',
    title: '1688AI，让生意更简单',
    description: '探讨大语言模型、多模态大模型在电商领域的应用，分享AIGC、AI应用构建等技术在电商业务中的实践。',
    startTime: new Date('2025-09-24T13:30:00'),
    endTime: new Date('2025-09-24T16:20:00'),
    location: 'D2-9',
    speakers: [speakers[0]],
    tags: ['ai_ml', 'big_data'],
    level: 'intermediate',
    category: 'technical_session',
    maxAttendees: 800,
    currentAttendees: 750,
    rating: 4.6
  },
  {
    id: 'agenda-8',
    title: '2025 AI原生架构峰会',
    description: '聚焦AI原生应用架构的设计理念、技术实现和最佳实践，探讨企业AI转型的架构演进路径。',
    startTime: new Date('2025-09-24T13:30:00'),
    endTime: new Date('2025-09-24T16:30:00'),
    location: 'D2-4',
    speakers: [speakers[1]],
    tags: ['ai_ml', 'microservices', 'devops'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 800,
    currentAttendees: 750,
    rating: 4.7
  },
  {
    id: 'agenda-9',
    title: 'AI Agent赋能产业升级：激活千行百业增长新动能',
    description: '深入探讨AI Agent技术在各行各业的应用场景，分享AI智能体推动产业升级的成功案例和实践经验。',
    startTime: new Date('2025-09-24T13:30:00'),
    endTime: new Date('2025-09-24T16:00:00'),
    location: 'D2-5',
    speakers: [speakers[2]],
    tags: ['ai_ml', 'iot'],
    level: 'intermediate',
    category: 'technical_session',
    maxAttendees: 600,
    currentAttendees: 580,
    rating: 4.6
  },
  {
    id: 'agenda-10',
    title: 'AI基础设施进化',
    description: '探讨大语言模型时代的AI基础设施技术进展，包括模型预训练、后训练、推理优化等关键技术。',
    startTime: new Date('2025-09-24T13:30:00'),
    endTime: new Date('2025-09-24T17:45:00'),
    location: 'D2-2',
    speakers: [speakers[1]],
    tags: ['ai_ml', 'cloud_computing'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 600,
    currentAttendees: 580,
    rating: 4.7
  },
  
  // 9月25日上午 - 无法计算的价值主论坛
  {
    id: 'agenda-11',
    title: '无法计算的价值',
    description: '探讨云计算和AI技术创造的无形价值，思考技术如何重塑商业模式和社会发展，开启价值创造新纪元。',
    startTime: new Date('2025-09-25T09:30:00'),
    endTime: new Date('2025-09-25T11:55:00'),
    location: '主会场',
    speakers: [speakers[0], speakers[2]],
    tags: ['cloud_computing', 'ai_ml'],
    level: 'beginner',
    category: 'keynote',
    maxAttendees: 5000,
    currentAttendees: 4900,
    rating: 4.9,
    isKeynote: true
  },
  {
    id: 'agenda-12',
    title: '通义千问大模型技术论坛',
    description: '深度剖析通义千问大模型的技术架构、训练方法和应用实践，展示中国自主研发大模型的技术实力。',
    startTime: new Date('2025-09-25T09:30:00'),
    endTime: new Date('2025-09-25T11:25:00'),
    location: 'D2-1',
    speakers: [speakers[1]],
    tags: ['ai_ml'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 1000,
    currentAttendees: 950,
    rating: 4.8
  },
  {
    id: 'agenda-13',
    title: 'AI Agent 驱动企业跃迁：开启超级公司新引擎',
    description: 'AI Agent技术如何驱动企业数字化转型，构建智能化业务流程，打造面向未来的超级公司。',
    startTime: new Date('2025-09-25T09:30:00'),
    endTime: new Date('2025-09-25T12:05:00'),
    location: 'A1-1',
    speakers: [speakers[0]],
    tags: ['ai_ml', 'big_data'],
    level: 'intermediate',
    category: 'technical_session',
    maxAttendees: 800,
    currentAttendees: 720,
    rating: 4.6
  },
  {
    id: 'agenda-14',
    title: 'AI+医疗丨大模型创新技术发展论坛',
    description: '探索AI大模型在医疗健康领域的创新应用，分享智能诊断、药物研发、精准医疗等前沿技术进展。',
    startTime: new Date('2025-09-25T09:30:00'),
    endTime: new Date('2025-09-25T12:20:00'),
    location: 'B3-2',
    speakers: [speakers[3]],
    tags: ['ai_ml', 'big_data'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 600,
    currentAttendees: 580,
    rating: 4.7
  },
  {
    id: 'agenda-15',
    title: 'AI浪潮下的NoSQL演进：下一代数据库的破局之道',
    description: '深入探讨AI时代NoSQL数据库的技术演进，分享向量数据库、多模态数据库等新技术的应用实践。',
    startTime: new Date('2025-09-25T09:30:00'),
    endTime: new Date('2025-09-25T11:55:00'),
    location: 'D1-4',
    speakers: [speakers[1]],
    tags: ['ai_ml', 'big_data'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 600,
    currentAttendees: 580,
    rating: 4.7
  },
  {
    id: 'agenda-16',
    title: '新“模”力 新点金：金融大模型技术峰会',
    description: '聚焦金融行业的AI大模型应用，探讨责任式AI、AI安全、模型后训练等技术在金融领域的具体应用。',
    startTime: new Date('2025-09-25T09:30:00'),
    endTime: new Date('2025-09-25T12:05:00'),
    location: 'B2-1',
    speakers: [speakers[3]],
    tags: ['ai_ml', 'security'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 600,
    currentAttendees: 580,
    rating: 4.7
  },
  
  // 9月25日下午 - 专业技术分论坛
  {
    id: 'agenda-17',
    title: '负责任的AI：AI风险治理与先进安全能力',
    description: '聚焦AI技术的责任与安全，探讨AI风险治理体系建设，推动可信AI技术发展和产业应用。',
    startTime: new Date('2025-09-25T14:00:00'),
    endTime: new Date('2025-09-25T16:50:00'),
    location: 'A1-2',
    speakers: [speakers[2], speakers[3]],
    tags: ['ai_ml', 'security'],
    level: 'expert',
    category: 'technical_session',
    maxAttendees: 500,
    currentAttendees: 480,
    rating: 4.8
  },
  {
    id: 'agenda-18',
    title: 'NVIDIA 专场：洞见 AI 未来',
    description: 'NVIDIA技术专家分享GPU加速计算、AI推理优化等前沿技术，展望AI计算的未来发展趋势。',
    startTime: new Date('2025-09-25T13:30:00'),
    endTime: new Date('2025-09-25T17:35:00'),
    location: 'B2-1',
    speakers: [speakers[4]],
    tags: ['ai_ml', 'cloud_computing'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 800,
    currentAttendees: 750,
    rating: 4.7
  },
  {
    id: 'agenda-19',
    title: '企业AI落地实践：AI原生应用架构论坛',
    description: '深入探讨AI原生应用的架构设计、开发实践和运维管理，分享企业AI落地的最佳实践和经验总结。',
    startTime: new Date('2025-09-25T13:30:00'),
    endTime: new Date('2025-09-25T17:10:00'),
    location: 'D3-2',
    speakers: [speakers[1], speakers[2]],
    tags: ['ai_ml', 'microservices', 'devops'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 600,
    currentAttendees: 570,
    rating: 4.6
  },
  
  // 9月26日 - 技术深入与生态合作
  {
    id: 'agenda-15',
    title: '2025第四届中国机器人云栖论坛',
    description: '汇聚机器人领域专家学者，探讨机器人技术与云计算、AI的深度融合，展望智能机器人产业发展前景。',
    startTime: new Date('2025-09-26T09:30:00'),
    endTime: new Date('2025-09-26T12:30:00'),
    location: 'D2-6',
    speakers: [speakers[4]],
    tags: ['ai_ml', 'iot'],
    level: 'intermediate',
    category: 'technical_session',
    maxAttendees: 600,
    currentAttendees: 550,
    rating: 4.5
  },
  {
    id: 'agenda-16',
    title: 'AI Agent开启未来序章：探索智能演进新路径',
    description: '深入探索AI Agent技术的演进路径，分析智能体在不同应用场景中的发展趋势和技术挑战。',
    startTime: new Date('2025-09-26T09:30:00'),
    endTime: new Date('2025-09-26T11:30:00'),
    location: 'D2-5',
    speakers: [speakers[1]],
    tags: ['ai_ml'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 500,
    currentAttendees: 480,
    rating: 4.7
  },
  {
    id: 'agenda-17',
    title: 'AI时代的数据库变革升级与实践',
    description: '探讨AI时代数据库技术的变革方向，分享云原生数据库、AI增强数据库等创新技术的实践经验。',
    startTime: new Date('2025-09-26T09:30:00'),
    endTime: new Date('2025-09-26T12:10:00'),
    location: 'D1-1',
    speakers: [speakers[2]],
    tags: ['ai_ml', 'big_data'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 800,
    currentAttendees: 750,
    rating: 4.6
  },
  {
    id: 'agenda-18',
    title: 'AI搜索与向量引擎',
    description: '深度解析AI搜索技术和向量数据库的核心技术，分享大规模向量检索、语义搜索等前沿应用实践。',
    startTime: new Date('2025-09-26T09:30:00'),
    endTime: new Date('2025-09-26T12:20:00'),
    location: 'D2-4',
    speakers: [speakers[1]],
    tags: ['ai_ml', 'big_data'],
    level: 'advanced',
    category: 'technical_session',
    maxAttendees: 600,
    currentAttendees: 580,
    rating: 4.7
  },
  {
    id: 'agenda-19',
    title: '通义千问Agentic Coding论坛',
    description: '展示AI编程助手的最新进展，探讨AI如何革命性地改变软件开发流程，提升开发效率和代码质量。',
    startTime: new Date('2025-09-26T09:30:00'),
    endTime: new Date('2025-09-26T12:00:00'),
    location: 'B3-3',
    speakers: [speakers[1]],
    tags: ['ai_ml', 'devops'],
    level: 'intermediate',
    category: 'technical_session',
    maxAttendees: 700,
    currentAttendees: 650,
    rating: 4.8
  },
  {
    id: 'agenda-20',
    title: '2025固件技术论坛暨BMC技术创新生态论坛',
    description: '聚焦服务器固件和BMC技术创新，探讨硬件管理、系统监控等底层技术的发展趋势和应用实践。',
    startTime: new Date('2025-09-26T13:30:00'),
    endTime: new Date('2025-09-26T17:30:00'),
    location: 'D1-4',
    speakers: [speakers[2]],
    tags: ['cloud_computing', 'devops'],
    level: 'expert',
    category: 'technical_session',
    maxAttendees: 400,
    currentAttendees: 380,
    rating: 4.5
  },
  {
    id: 'agenda-21',
    title: '设计 & AI 的共生',
    description: '探索设计与AI技术的深度融合，分享AIGC在创意设计、UI/UX设计等领域的创新应用和发展前景。',
    startTime: new Date('2025-09-26T13:30:00'),
    endTime: new Date('2025-09-26T16:55:00'),
    location: 'B2-1',
    speakers: [speakers[5]],
    tags: ['ai_ml'],
    level: 'beginner',
    category: 'technical_session',
    maxAttendees: 500,
    currentAttendees: 450,
    rating: 4.6
  }
];

// 按时间排序的议程
export const sortedAgendaItems = agendaItems.sort(
  (a, b) => a.startTime.getTime() - b.startTime.getTime()
);

// 按类别分组的议程
export const agendaByCategory = agendaItems.reduce((acc, item) => {
  if (!acc[item.category]) {
    acc[item.category] = [];
  }
  acc[item.category].push(item);
  return acc;
}, {} as Record<SessionCategory, AgendaItem[]>);

// 按技术标签分组的议程
export const agendaByTags = agendaItems.reduce((acc, item) => {
  item.tags.forEach(tag => {
    if (!acc[tag]) {
      acc[tag] = [];
    }
    acc[tag].push(item);
  });
  return acc;
}, {} as Record<TechPreference, AgendaItem[]>);

// 热门议程（按评分和参与度排序）
export const popularAgendaItems = agendaItems
  .filter(item => item.rating && item.rating >= 4.5)
  .sort((a, b) => {
    const scoreA = (a.rating || 0) * 0.7 + (a.currentAttendees || 0) / (a.maxAttendees || 1) * 0.3;
    const scoreB = (b.rating || 0) * 0.7 + (b.currentAttendees || 0) / (b.maxAttendees || 1) * 0.3;
    return scoreB - scoreA;
  });

// 获取特定日期的议程
export const getAgendaByDate = (date: Date): AgendaItem[] => {
  return agendaItems.filter(item => {
    const itemDate = new Date(item.startTime);
    return itemDate.toDateString() === date.toDateString();
  });
};

// 获取特定技术偏好的议程
export const getAgendaByTechPreference = (preferences: TechPreference[]): AgendaItem[] => {
  return agendaItems.filter(item => 
    item.tags.some(tag => preferences.includes(tag))
  );
};

// 获取特定难度级别的议程
export const getAgendaByLevel = (level: ExperienceLevel): AgendaItem[] => {
  return agendaItems.filter(item => item.level === level);
};